<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{mensagens.EditLocacaoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{mensagens.EditLocacaoLabel_idLocacao}" for="idLocacao" />
                    <h:inputText id="idLocacao" value="#{locacaoController.selected.idLocacao}" title="#{mensagens.EditLocacaoTitle_idLocacao}" required="true" requiredMessage="#{mensagens.EditLocacaoRequiredMessage_idLocacao}"/>
                    <h:outputLabel value="#{mensagens.EditLocacaoLabel_data}" for="data" />
                    <h:inputText id="data" value="#{locacaoController.selected.data}" title="#{mensagens.EditLocacaoTitle_data}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{mensagens.EditLocacaoLabel_clienteIdPessoa}" for="clienteIdPessoa" />
                    <h:selectOneMenu id="clienteIdPessoa" value="#{locacaoController.selected.clienteIdPessoa}" title="#{mensagens.EditLocacaoTitle_clienteIdPessoa}" required="true" requiredMessage="#{mensagens.EditLocacaoRequiredMessage_clienteIdPessoa}">
                        <f:selectItems value="#{clienteController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{locacaoController.update}" value="#{mensagens.EditLocacaoSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{mensagens.EditLocacaoViewLink}"/>
                <br />
                <h:commandLink action="#{locacaoController.prepareList}" value="#{mensagens.EditLocacaoShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{mensagens.EditLocacaoIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
